package com.databinding.jetpacktesting.room

import androidx.lifecycle.LiveData
import androidx.room.*

/**
 * Created by harisucici on 2020/3/14
 * Class description:
 */
//database access object 数据库操作接口
@Dao
interface WordDao {
    @Insert
    fun insertWords(vararg wordEntities: WordEntity?)

    @Update
    fun update(vararg wordEntities: WordEntity?): Int

    @Delete
    fun deleteWords(vararg wordEntities: WordEntity?)

    @Query("delete from wordentity")
    fun deletAll()

    @get:Query("select * from wordentity order by id desc")
    val allWordsLife: LiveData<List<WordEntity?>?>?
}